import request from '@/utils/request'
import qs from 'qs'


export function pageDepartment(current, limit, name) {
    return request({
        url: `/manager/pageDepartment/${current}/${limit}`,
        method: 'get',
        params: { name }
    })
}
export function getAllDepartment() {
    return request({
        url: `/manager/getAllDepartment`,
        method: 'get'
    })
}


export function getDepartmentById(id) {
    return request({
        url: `/manager/getDepartmentById/${id}`,
        method: 'get'
    })
}


export function saveDepartment(params) {
    return request({
        url: `/manager/saveDepartment`,
        method: 'post',
        data: qs.stringify(params)
    })
}


export function deleteDepartmentById(id) {
    return request({
        url: `/manager/deleteDepartmentById/${id}`,
        method: 'delete'
    })
}


export function updateDepartment(name) {
    return request({
        url: `/manager/updateDepartment`,
        method: 'post',
        params: name
    })
}